//package com.example.springbatchdemo.job.itemRead;
//
//import com.example.springbatchdemo.Person;
//import org.springframework.batch.item.ItemReader;
//import org.springframework.batch.item.NonTransientResourceException;
//import org.springframework.batch.item.ParseException;
//import org.springframework.batch.item.UnexpectedInputException;
//import org.springframework.batch.item.file.FlatFileItemReader;
//import org.springframework.batch.item.file.builder.FlatFileItemReaderBuilder;
//import org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapper;
//import org.springframework.core.io.ClassPathResource;
//
//
//public class MyItemRead implements ItemReader<FlatFileItemReader,Person> {
//
//    @Override
//    public FlatFileItemReader read(Person person) throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException {
//        return new FlatFileItemReaderBuilder<Person>()
//                .name("personItemReader")
//                .resource(new ClassPathResource("sample-data.csv"))
//                .delimited()
//                .names(new String[]{"name", "age"})
//                .fieldSetMapper(new BeanWrapperFieldSetMapper<Person>() {{
//                    setTargetType(Person.class);
//                }})
//                .build();
//    }
//
//}
